<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../../common/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<sfa:mainTitle></sfa:mainTitle>
<%@ include file="../../common/meta.jsp"%>
<script type="text/javascript">
	$(document).ready(function(){
		if("${msg}")
		{
			alert("${msg}");
			location.href="${path}/manage/role/index/getusers";
		}
	});
	
	$(function() {
	$("#fullScreen").click(function() {
		fullScreen.FullScreen("mytable");
	});
	
	
	$(".isAllow").click(function() {
		var content="";
		var userStatus = $(this).attr("userStatus");
		if(userStatus=="y")
		{
			content="确定要禁用吗?";
		}else
		{
			content="确定要启用吗？";
		}
		var loginName=$(this).attr("loginName");
		//alert(saleNewsId);
			var url = "${path }/manage/role/index/isallow?userStatus="+userStatus+"&loginName="+loginName;
			art.dialog( {
				lock : true,
				content : content,
				ok : function() {
					art.dialog( {
						id : "loading",
						lock : true,
						drag : false,
						resize : false,
						title : "正在进行...",
						time : 5
					});
					$.post(url, null, function(result) {
						art.dialog( {
							id : 'loading'
						}).close();//关闭等待框
							if (result.isDel) {
								art.dialog( {
									icon : "succeed",
									content : "操作成功!",
									lock : true,
									ok : function() {
										location.reload();
									}
								});
							} else {
								art.dialog( {
									icon : "error",
									content : "操作失败!",
									lock : true,
									ok : true
								});
							}

						});

					return true;
				},
				cancelVal : '取消',
				cancel : true
			//为true等价于function(){}
					});

		});
})
</script>
</head>

<body id="master">

	<sfa:mainHeader></sfa:mainHeader>
	
	<!--右边-->
            <div class="webpart3 contentarea">
                <div class="webpart-head">
                    <div class="webpart-head-item">
                       管理助理
                        <div class="tools-btn">
                            <a href="${path}/manage/role/index/adduser"  ><span>
                                <img src="${path}/statics/images/add2.gif" style="margin-right: 4px;" />新建</span></a>
                            &nbsp;&nbsp;<a href="####" id="fullScreen"><span>
                                <img src="${path}/statics/images/qp.gif" style="margin-right: 4px; margin-bottom: -3px;" />全屏</span></a></div>
                    </div>
                </div>
                <div class="webpart-main">
                    <div class="webpart-main-item" style="padding-top: 12px;">
                        
                        <!----------- 数据列表 ------------------>
                        <table cellpadding="0" cellspacing="0" class="dg_borderstyle trStyleTable" style="margin-top: 15px;" id="mytable">
                            <tr>
                            <th name="fixcol"><span>序号</span></th>
                                <th>
                                    用户名
                                </th>
                                <th>
                                    姓名
                                </th>
                                <th>
                                    所属机构
                                </th>
                                <th>
                                    邮箱地址
                                </th>
                                <th width="70">
                                    操作
                                </th>
                            </tr>
                            <c:forEach items="${users}" var="user" varStatus="ind">
                            <tr   align="center">
                            	<td>${(ind.index+1)}</td>
                                <td align="center">
                                    ${user.loginName }
                                </td>
                                <td>
                                   	 ${user.agentname }
                                </td>
                                <td>
                                   	${user.branchname}
                                </td>
                                <td>
                                    ${user.email }
                                </td>
                                <td align="center" width="20%">
                                    <c:set value="${user.userStatus}" var="userStatus"></c:set>
                                    <c:if test="${userStatus=='y'}">
                                    <a href="${path }/manage/role/index/updatepwd?menuId=n5g1c3&loginName=${user.loginName}">修改 </a>
                                    </c:if>
								
			<c:if test="${sessionScope.user.userType=='USERTYPE_1'}">		
			<c:if test="${userStatus=='y' && user.saleUsersLoginId!=sessionScope.user.saleUsersLoginId}">
				<a href="javascript:void(0)" class="isAllow" userStatus="y" loginName="${user.loginName}">禁用</a>
			</c:if>
			<c:if test="${userStatus=='n'}">
				<a href="javascript:void(0)" class="isAllow" userStatus="n" loginName="${user.loginName}">启用</a>
			</c:if>
			</c:if>
                                </td>
                            </tr>
                           </c:forEach>
                           
                        </table>
                        
                    
                </div>
                <div class="webpart-foot">
                    <div class="webpart-foot-item">
                    </div>
                </div>
            </div>
        </div>
       
	<sfa:mainFooter></sfa:mainFooter>

</body>
</html>


